<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>首页-后台管理系统</title>
		<link rel="stylesheet" href="${rc.contextPath}/bootstrap/css/bootstrap.css" />
		<link rel="stylesheet" href="${rc.contextPath}/zui/css/zui.css" />
		<script type="text/javascript" src="${rc.contextPath}/js/jquery.1.10.1.min.js"></script>
		<script type="text/javascript" src="${rc.contextPath}/zui/js/zui.js"></script>
	</head>

	<body>
		<ul class="nav nav-tabs" id="adminTab">
			<li class="active">
				<a href="${rc.contextPath}/admin/index" data-togggle="tab">首页</a>
			</li>
			<li>
				<a href="${rc.contextPath}/admin/enterprise_manage" data-togggle="tab">企业管理及审核</a>
			</li>
			<li>
				<a href="${rc.contextPath}/admin/forum_manage" data-togggle="tab">论坛管理</a>
			</li>
			<li>
				<a href="${rc.contextPath}/admin/message" data-togggle="tab">消息</a>
			</li>
			<li class="pull-right">
				<a href="#" class="dropdown-toggle" data-toggle="dropdown">
					<img src="${rc.contextPath}/img/leader_default.png" width="20px" />管理员<span class="caret"></span>
				</a>
				<ul class="dropdown-menu">
					<li>
						<a href="#">账号设置</a>
					</li>
					<li>
						<a href="${rc.contextPath}/admin/logout">退出</a>
					</li>
				</ul>
			</li>
		</ul>

		<div style="margin-top: 20px;" class="col-xs-2">
			<nav class="menu" data-toggle="menu" style="width: 200px;">
				<ul class="nav nav-primary">

					<li class="active show nav-parent">
						<a href="javascript:;"><i class="icon icon-book"></i> 校园公告管理</a>
						<ul class="nav">
							<li class="active">
								<a href="javascript:;" ><i class="icon icon-list-ul"></i> 公告管理</a>
							</li>
							<li>
								<a href="${rc.contextPath}/admin/campus/add" ><i class="icon icon-pencil"></i> 发布公告</a>
							</li>
						</ul>
					</li>
					<!-- <li>
						<a href="#"><i class="icon icon-picture"></i> 首页轮播管理</a>
					</li> -->
					
				</ul>
			</nav>
		</div>

		<div class="col-xs-8" style="margin-top: 20px;">
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th width="80%">标题</th>
						<th>阅读量</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
				
				#foreach($!news in $!newsList)
					<tr>
						<td>
							<a href="${rc.contextPath}/campus/detail/$!news.id" target="_blank">$!news.news_title</a>
						</td>
						<td>$!news.news_see</td>
						<td>
							<a href="${rc.contextPath}/admin/campus/edit?id=$!news.id" title="编辑"><i class="icon icon-edit"></i></a>&nbsp;|&nbsp;
							<a href="#" class="delnews" title="删除" data-id="$!news.id"><span class="icon-trash"></span></a>
						</td>
					</tr>
				#end	

				</tbody>
			</table>
			<div class="pagination" style="margin: 0px 0 20px;">$!page.pageString</div>
		</div>

	</body>
	<script type="text/javascript">
	$(".delnews").click(function(){
			if(confirm("是不是确认删除咯？")){
				jQuery.getJSON('${rc.contextPath}/admin/campus/del?id='+$(this).data("id"),function(data){
					if(data.code == 200){
						(new jQuery.zui.ModalTrigger({
							custom : data.info
						})).show({hidden: function(){
							location.reload();
						}});
					}else{
						(new jQuery.zui.ModalTrigger({
							custom : data.info
						})).show();
					}
				})
			}
		});
	</script>

</html>